package com.android.djlmapp.js_interface.order;

import android.content.Context;
import android.webkit.JavascriptInterface;

import com.android.djlmapp.js_interface.BaseJsInterface;
import com.just.agentweb.AgentWeb;

/**
 * @Author wangziheng
 * @ProjectName djlm
 * @ClassName OrderDetailJsInterface
 * @package com.android.djlmapp.js_interface.order
 * @data 2018/12/25 17:29
 * @Describe
 * @Change
 */
public class OrderDetailJsInterface extends BaseJsInterface {
    private AbOrderDetailJsInterfaceCallBack mOrderDetailJsInterfaceCallBack;

    public OrderDetailJsInterface(Context context, AbOrderDetailJsInterfaceCallBack jsInterfaceCallBack, AgentWeb agentWeb) {
        super(context, jsInterfaceCallBack, agentWeb);
        mOrderDetailJsInterfaceCallBack = jsInterfaceCallBack;
    }

    /**
     * 上传照片
     */
    @JavascriptInterface
    public void NativeGetImage() {
        getHandler().post(() -> mOrderDetailJsInterfaceCallBack.getImg());
    }

    /**
     * 上传签名
     */
    @JavascriptInterface
    public void NativeGetSign() {
        getHandler().post(() -> mOrderDetailJsInterfaceCallBack.getSign());
    }

    /**
     * 搜索号码
     *
     * @param strJson
     */
    @JavascriptInterface
    public void NativeGetPhonenum(String strJson) {
        getHandler().post(() -> mOrderDetailJsInterfaceCallBack.getPhonenum(strJson));
    }

    /**
     * sim卡号
     */
    @JavascriptInterface
    public void NativeScanSim() {
        getHandler().post(() -> mOrderDetailJsInterfaceCallBack.getSimNum());
    }

    /**
     * 补卡回调
     *
     * @param json
     */
    @JavascriptInterface
    public void onSubmit(String json) {
        getHandler().post(() -> mOrderDetailJsInterfaceCallBack.bkSubmit(json));
    }
}
